#include <iostream>
using namespace std;

class Saler
{
	private :
		string m_num;//售货员的ID
		double m_dis;//折扣
		int m_count;//销售件数
		double m_price;//销售单价

		static double sum;//总销售款
		static int count;//总销售件数

	public :
		Saler(string num = "", int cnt = 0, double dis = 1, double price = 100) :
			m_num(num), m_count(cnt), m_dis(dis), m_price(price)
		{
			while(m_count >= 10)
			{
				m_dis *= 0.98;
				if(m_dis <= 0.8)
				{
					m_dis = 0.8;
					break;
				}

				m_count -= 10;
			}//折扣计算

			m_price *= m_dis;
			sum += m_price *cnt;
			count += cnt;//总数量

			cout << "Price : " << m_price << endl;
			cout << "Count : " << count << endl;
		}

		static double get_sum()
		{
			return sum;
		}

		static double average()
		{
			return sum / count;
		}
	protected :
};

double Saler :: sum = 0;
int Saler :: count = 0;

int main()
{
	Saler s1("0", 5);
	Saler s2("1", 12);
	Saler s3("2", 121);

	cout << "Sum is : " << Saler :: get_sum() << endl;
	cout << "Average is : " << Saler :: average() << endl;
}
